{% extends 'bootstrap/base.html' %}

{% block metas %}
    <meta name="charset" content="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
{% endblock metas %}

{% block styles %}
    <!-- Bootstrap -->
    <link href="http://apps.bdimg.com/libs/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
{% endblock styles %}

{% block title %}
    {% if title %}
        {{ title }} - Microblog
        {% else %}
        Welcome to Microblog
    {% endif %}
{% endblock title %}


{% block navbar %}
<div class="navbar-wrapper">
<div class="container">
    <nav class="navbar navbar-static-top">
        <a href={{url_for('index')}}>Home</a>
        {% if current_user.is_anonymous %}
        <a href={{url_for('login')}}>Login</a>
        {% else %}
        <a href={{url_for('logout')}}>Logout</a>
        <a href={{url_for('user', username=current_user.username)}}>Profile</a>
        <a href={{url_for('explore')}}>Explore</a>
        {% endif %}
    </nav>
</div>
</div>
{% endblock navbar%}

{% block content %}
    {% with messages = get_flashed_messages() %}
        {% if messages %}
        <ul>
            {% for message in messages %}
            <li>{{ message }}</li>
            {% endfor %}
        </ul>
        {% endif %}
        {% endwith %}

        {# application content needs to be provided in the app_content block #}
        {% block app_content %}{% endblock app_content %}
{% endblock content %}

{% block scripts %}
    <script src="http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js"></script>
    <script src="http://apps.bdimg.com/libs/bootstrap/3.2.0/js/bootstrap.min.js"></script>
{% endblock scripts %}
